package com.extr.controller;

import com.extr.domain.user.School;
import com.extr.persistence.SchoolMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import java.util.List;

@Controller
public class SchollController {

    @Autowired
    private SchoolMapper schoolMapper;

    @ResponseBody
    @RequestMapping(value = "school/grade_list",method = {RequestMethod.GET})
    public List<School> findGradeList(String stud_school){
        return schoolMapper.selectByGrade(stud_school);
    }

    @ResponseBody
    @RequestMapping(value = "school/class_list",method = {RequestMethod.GET})
    public List<School> findClassList(String stud_school,String stud_grade){
        return schoolMapper.selectByClass(stud_school,stud_grade);
    }

}
